<%@ page language="java" pageEncoding="UTF-8"%><%@ taglib prefix="s" uri="/struts-tags"%>
<script type="text/javascript" src="<%=request.getContextPath()%>/order/js/order_vendor_action.js"></script>
<s:if test="orderVendor!=null">
	<div id="vendorNote">
		<h1>
			我的订单供应信息如下：
		</h1>
	</div>
	<script> jtool.flashview("vendorNote");</script>
	<s:set name="orderVendor" value="orderVendor" />
	<input type="hidden" id="vendorId" value="<s:property value="#orderVendor.id" />" />
	<s:if test="#order.votedVendor.id.equals(#orderVendor.id)">
	你在此次订单投票中中标了,请根据客户提供的联系信息进行交易。
	</s:if>
	<div class="box_blue">
		<div class="box_title">
			<div class="more">
				请填写针对此订单的相关说明(如公司介绍、订单优惠等)，以供客户为供应商投票时作为参考!
			</div>
			订单相关说明
			<input type="button" id="btn_declaration_edit" onclick="javascript:editDeclaration();" value="编辑" />
		</div>
		<div id="declarationShow">
			<s:if test="#orderVendor.declaration==null">
				还未填写!
			</s:if>
			<s:else>
				<s:property value="toHtml(#orderVendor.declaration)" escape="false" />
			</s:else>
		</div>
		<textarea id="declaration" name="declaration" rows="7" style="width: 760px; display: none;"><s:property value="#orderVendor.declaration" />
		</textarea>
		<br />
		<input id="btn_declaration_save" style="display: none;" onclick="javascript:saveDeclaration();" class="btn_blue_2" value="保存" />
	</div>

	<div class="box_blue">
		<div class="box_title">
			我的订单报价情况
		</div>
		<ul>
			<s:set name="quoteMap" value="#orderVendor.quoteMap" />
			<s:iterator value="#order.customers" status="custemerStatus">
				<s:set name="customer" value="top" />
				<li class="box">
					<font class="red bold">客户 <s:property value="#custemerStatus.index+1" /> </font>
					<s:if test="#order.isConfirmed() && #order.votedVendor.id.equals(#orderVendor.id)">
						<input type="button" value="查看客户联系信息" onclick="javascript:viewCustomerAddress('<s:property value="#order.id"/>','<s:property value="#customer.id"/>','<s:property value="#orderVendor.id"/>')" />
					</s:if>
					 <br/>地区:
					<s:property value="#customer.address.region.fullName" />
					<br/>送货方式:
					<s:text name="deliverType_%{#customer.deliverType.ordinal()}" /><br/>
					付款方式:
					<s:text name="payType_%{#customer.payType.ordinal()}" />
					<table style="width: 100%;">
						<tr>
							<th width="20">
								NO.
							</th>
							<th>
								商品/服务名称
							</th>
							<th width="200">
								要求
							</th>
							<th width="50">
								单位数量
							</th>
							<th width="150">
								商品/服务单价
							</th>
							<th width="150">
								运费/杂费
							</th>
							<th width="100"></th>
						</tr>

						<s:iterator value="#customer.orderRequests" status="status">
							<s:set name="orderRequest" value="top" />
							<s:set name="quote" value="#quoteMap.get(#orderRequest)" />
							<tr <s:if test="#quote.hasQuoted()">quoted="true"</s:if> <s:else>quoted="false"</s:else>>
								<td>
									<s:property value="#status.index+1" />
								</td>
								<td>
									<a href="<%=request.getContextPath()%>/product/viewProduct.do?id=<s:property value="#orderRequest.product.id" />"> <s:property value="#orderRequest.product.name" /> </a>
								</td>
								<td>
									<s:property value="toHtml(#orderRequest.comment)" escape="false" />
								</td>
								<td>
									<s:property value="#orderRequest.count" />
								</td>
								<td>
									<span class="amount_show" style="margin-right: 10px; cursor: pointer; display: inline;" name="amount"><s:property value="#quote.amount" /> </span>
									<input class="amount_input" style="display: none;" name="amount" value="<s:property value="#quote.amount" />" />
								</td>
								<td>
									<span class="amount_show" style="margin-right: 10px; cursor: pointer; display: inline;" name="carriage"><s:property value="#quote.carriage" /> </span>
									<input class="amount_input" style="display: none;" name="carriage" value="<s:property value="#quote.carriage" />" />

								</td>
								<td>
									<s:if test="#order.isInviting() || #order.isQuoting()">
										<label class="action_button" style="cursor: pointer; display: inline; color: red;" onclick="javascript:editOrderQuote(this);">
											<s:if test="#quote.hasQuoted()">修改</s:if>
											<s:else>报价</s:else>
										</label>
									</s:if>
									<input class="edit_button" style="display: none;" value="确认" type="button" onclick="javascript:saveOrderQuote(this,'<s:property value="#quote.id"/>')" />
									<input class="edit_button" style="display: none;" value="取消" type="button" onclick="javascript:cancelQuote(this,'<s:property value="#quote.id"/>')" />

								</td>
							</tr>
						</s:iterator>
					</table>

				</li>
			</s:iterator>
		</ul>
	</div>
</s:if>
